	package metier;

	import java.util.ArrayList;
	import java.util.List;

	import modele.Administrateur;
import modele.Emplacement;
	import modele.Region;

	import dao.AdministrateurDao;
import dao.EmplacementDao;
import dao.RegionDao;

	public class EmplacementMetier {

		public static boolean ajouterEmplacement(Region region) {

			RegionDao.ajouterRegion(region);
			return true;

		}

		public static Administrateur getAdministrateur(long idAdministrateur) {
			return AdministrateurDao.getAdministrateur(idAdministrateur);
		}

		public static boolean modifierRegion(Region region) {

			Region reg = RegionDao.getRegion(region.getIdentifiant());
			reg.setNom(region.getNom());
			reg.setDescription(region.getDescription());
			reg.setPopulation(region.getPopulation());
			RegionDao.modifierRegion(reg);
			return true;

		}

		public static List<Emplacement> getListeEmplacements(String niveau_base) {
			
			return EmplacementDao.getListeEmplacements(niveau_base);
		}

		public static void supprimerRegion(long idRegion) {
			Region region = RegionDao.getRegion(idRegion);
			RegionDao.supprimerRegion(region);
		}

		public static Region getRegion(long identifiant) {
			return RegionDao.getRegion(identifiant);
		}

		public static List<Region> getListeRegions(long idAdmin) {
			return RegionDao.getListeRegions(idAdmin);
		}

		public static ArrayList<Region> rechercherRegions(Region region) {
			return RegionDao.rechercherRegionsParCriteresParAdmin(region);
		}

	
	
	public static Emplacement getEmplacement(long emp)
	{
		return EmplacementDao.getEmplacement(emp);
	}

}
